package com.cysyz.mylib.utils.count;

/**
 * @File name : CoutCheck
 * @Description :
 * @Creator : cuiyong
 * @CreateTime : 2016/10/21 12:07
 * @Version : 1.0
 * @Update records:
 * 1.0 2016/10/21 by cuiyong: Created
 * All rights served : SINA Corporation
 */
public class CountCheck {

    private CountDao countDao;
    private int countLimit;

    public void checkCount(String id) {
        int count = countDao.getCount(id);
        if (count > countLimit) {
            throw new CountCheckException("the count is out of limit");
        }
    }

    public CountDao getCountDao() {
        return countDao;
    }

    public void setCountDao(CountDao countDao) {
        this.countDao = countDao;
    }

    public int getCountLimit() {
        return countLimit;
    }

    public void setCountLimit(int countLimit) {
        this.countLimit = countLimit;
    }
}
